<?php

namespace Xsjosg\Zt\App\Webapp\Sixyear251014\Models;

use Xsjosg\Zt\Core\Database\Model;
use Xsjosg\Zt\Core\Helper\Formatter;

class RewardLog extends Model
{
    protected $connection = 'webapp';
    protected $table = 'sixyear251014_reward_log';

    // 奖励类型常量
    const REWARD_TYPE_SHARE = 1;
    const REWARD_TYPE_ANNUAL_REPORT = 2;

    // 奖励类型映射
    public static $rewardTypeMap = [
        self::REWARD_TYPE_SHARE => '分享奖励',
        self::REWARD_TYPE_ANNUAL_REPORT => '周年奖励'
    ];


    // 状态常量
    const STATUS_UNCLAIMED = 0;
    const STATUS_CLAIMED = 1;

    // 状态映射
    public static $statusMap = [
        self::STATUS_UNCLAIMED => '未领取',
        self::STATUS_CLAIMED => '已领取'
    ];

    public static function formatStatus($status)
    {
        $styleStatus = $status == self::STATUS_UNCLAIMED ? 'metal' : 'success';
        return Formatter::state(self::$statusMap[$status], $styleStatus);
    }
}
